#include<stdio.h>
#include<errno.h>
#include<string.h>


extern int errno;


int main()
{
	// open file 
	//FILE *fp = fopen("./prinf.c","r+");

	
	FILE *fp = fopen("./2.txt","w");

	//FILE *fp = fopen("./2.txt","a+b");


	if(!fp){
		//printf("fopen failed!\n");
		//perror("fopen");
		//printf("fopen:%m\n");
		printf("errno = %d,fopen:%s\n",errno,strerror(errno));



		return -1;

	}
	printf("open successed!\n");
	
	//close file

	fclose(fp);



	return 0;
}